import xadmin
from apps.order.models import OrderInfo, OrderGoods


class OrderInfoAdmin(object):
    list_display = ['order_id', 'user', 'addr', 'pay_method', 'total_count','total_price','transit_price','order_status','trade_no','create_time','update_time','is_delete']
    # list_editable= ['order_id', 'user', 'pay_method', 'total_count','total_price','transit_price','order_status','trade_no','create_time','update_time','is_delete']
    search_fields = ['order_id', 'user', 'addr', 'pay_method']
    list_filter = ['order_id', 'user', 'addr', 'pay_method', 'create_time','update_time']


class OrderGoodsAdmin(object):
    list_display = ['order', 'sku', 'count', 'price', 'comment','create_time','update_time','is_delete']
    search_fields = ['order',]
    list_filter = ['order', 'sku','create_time']


xadmin.site.register(OrderInfo, OrderInfoAdmin)
xadmin.site.register(OrderGoods,OrderGoodsAdmin)